import http from "./http";
import { ListResponse } from "@/api/types/ApiResponse";

/**
 * 查询当前用户可以操作的所有应用
 */
export const selectCurrentUserAppList = (): Promise<ListResponse<any>> => {
  return http.doGet("/AuthApp/userContext/selectCurrentUserAppList");
};

export const selectCurrentUserMenu = (appCode: string | null): Promise<ListResponse<any>> => {
  return http.doGet("/AuthApp/userContext/selectCurrentUserMenu", { appCode });
};
export const selectCurrentAppAndUserMenu = (appCode: string | null): Promise<ListResponse<any>> => {
  return http.doGet("/AuthApp/userContext/selectCurrentAppAndUserMenu", { appCode });
};
export const selectCurrentUserPermission = (appCode: string | null): Promise<ListResponse<any>> => {
  return http.doGet("/AuthApp/userContext/selectCurrentUserPermission", { appCode });
};
export default {
  selectCurrentUserMenu,
  selectCurrentUserAppList,
  selectCurrentAppAndUserMenu,
  selectCurrentUserPermission
};
